package com.hzncc.flowable_diboot.dto.processtransaction;

import com.diboot.core.binding.query.BindQuery;
import com.diboot.core.binding.query.Comparison;
import com.diboot.iam.entity.IamOrg;
import com.diboot.iam.entity.IamUser;
import com.diboot.tenant.entity.IamTenant;
import com.hzncc.flowable_diboot.entity.processtransaction.ProcessTask;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
* 我的待办 DTO定义
*
* @author MyName
* @version 1.0
* @date 2024-11-04
 * Copyright © MyCorp
*/
@Getter
@Setter
@Accessors(chain = true)
public class ProcessTaskDTO extends ProcessTask  {
    private static final long serialVersionUID = 1108922248523241035L;

    /**
    * id集合
    */
    @BindQuery(comparison = Comparison.IN, field = "id")
    private List<String> ids;

    /**
    * 开始时间
    */
    @BindQuery(comparison = Comparison.GE)
    private LocalDateTime startTime;

    /**
    * 开始时间 起始
    */
    @BindQuery(comparison = Comparison.GE, field = "startTime")
    private LocalDateTime startTimeBegin;

    /**
    * 开始时间 截止
    */
    @BindQuery(comparison = Comparison.LT, field = "startTime")
    private LocalDateTime startTimeEnd;

    public LocalDateTime getStartTimeEnd() {
        if (getStartTime() != null) {
            return getStartTime().plusDays(1);
        }
        if (startTimeEnd != null) {
            return startTimeEnd.plusDays(1);
        }
        return null;
    }

}